﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="DataEdit" Codebehind="DataEdit.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Data Edit</title>
</head>
<body background="https://minisaas.blob.core.windows.net/img/bg.jpg">
    <form id="frmDataEdit" runat="server">
    <div>
        <a href="ObjectEdit.aspx">Return to Object Edit</a><br />
        <br />
        Table ID:
        <asp:Label ID="lblTableID" runat="server"></asp:Label>
        <br />
        Table Version:
        <asp:Label ID="lblTableVer" runat="server"></asp:Label>
        <br />
        <br />
        <asp:Label ID="Label5" runat="server" Font-Bold="True" Font-Size="Large" 
            Text="Attributes:"></asp:Label>
        <asp:XmlDataSource ID="XmlDataSource2" runat="server">
        </asp:XmlDataSource>
    
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" ForeColor="#333333" GridLines="None">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:BoundField DataField="columnID" HeaderText="columnID" />
                <asp:BoundField DataField="name" HeaderText="Name" />
                <asp:BoundField DataField="type" HeaderText="Type" />
                <asp:BoundField DataField="allownull" HeaderText="AllowNull" />
                <asp:BoundField DataField="default" HeaderText="Default" />
                <asp:BoundField DataField="priKey" HeaderText="priKey" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <br />
        <asp:Label ID="Label1" runat="server" Text="Data ID"></asp:Label>
        <asp:DropDownList ID="ddbDataID" runat="server" AutoPostBack="True" 
            onselectedindexchanged="ddbDataID_SelectedIndexChanged" >
        </asp:DropDownList>
        <asp:Label ID="lblErr" runat="server" ForeColor="Red"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btnDel" runat="server" Text="Delete" onclick="btnDel_Click" />
        <br />
        <asp:XmlDataSource ID="XmlDataSource1" runat="server">
        </asp:XmlDataSource>
    
    </div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        onrowupdating="GridView1_RowUpdating" BackColor="White" 
        BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
        ForeColor="Black" GridLines="Vertical" 
        onrowcancelingedit="GridView1_RowCancelingEdit" 
        onrowediting="GridView1_RowEditing" >
            <RowStyle BackColor="#F7F7DE" />
            <Columns>
                <asp:TemplateField HeaderText="columnID">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("columnID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="coldata" HeaderText="Data Value" />
                <asp:TemplateField ShowHeader="False">
                    <EditItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Edit"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            
            <FooterStyle BackColor="#CCCC99" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
            
        </asp:GridView>
        <asp:HiddenField ID="HiddenField1" runat="server" />
    <br />
    <asp:Button ID="btnSubmit" runat="server" 
        Text="submit" onclick="btnSubmit_Click" />
    
    
    <br />
    <asp:Label ID="Label4" runat="server" Text="Column ID" Visible="False"></asp:Label>
    :
    <asp:TextBox ID="txtColid" runat="server" Visible="False"></asp:TextBox>
    <br />
    <asp:Label ID="Label3" runat="server" Text="New Value" Visible="False"></asp:Label>
    :&nbsp;<asp:TextBox ID="txtNew" runat="server" Visible="False"></asp:TextBox>
&nbsp;&nbsp;<br />
    <br />
    <br />
&nbsp;<br />
    <asp:Label ID="lblSubmitErr" runat="server" ForeColor="Red"></asp:Label>
    </form>

</body>
</html>
